#ifndef TEXTCLASSIFY_H
#define TEXTCLASSIFY_H

#include <QWidget>
#include "ui_textclassify.h"
#include <QDir>
#include "classifier.h"
#include <QThread>

class RenderThread : public QThread  
{  
	Q_OBJECT  
signals:  
	void notify(int);  
public:  
	RenderThread(QObject *parent = 0): QThread(parent)  
	{  

	};  
	void test()  
	{  
		start(HighestPriority);  
	};  
protected:  
	void run()  
	{  
		int i =0;  
		while (i<100)  
		{  
			msleep(50);  
			i++;  
			emit notify(i);  
			if (i == 99)
			{
				i = 0;
			}
		}  

	};  
};  
class TextClassify : public QWidget
{
	Q_OBJECT

public:
	TextClassify(QWidget *parent = 0);
	~TextClassify();

private slots:
	void chooseFolder();
	void chooseFile();
	void runAnalyse();
	void onNotify(int i);

private:
	Ui::TextClassifyClass ui;
	QDir _directory;
	Classifier *_classfier;
	RenderThread _progressThread;
};

#endif // TEXTCLASSIFY_H
